<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
     <canvas id="canvas" width="500" height="500" style="border:25px solid #0342"></canvas>
</body>
</html>

<script type="text/javascript">
	var canvas =document.getElementById('canvas');
	var context = canvas.getContext('2d');

	context.fillText('hello word!',20,50);
	context.font = '30px Arial';

	var gradient = context.createLinearGradient(0,0,100,0);
	gradient.addColorStop(0,'magenta');
	gradient.addColorStop(0.5,'purple');
	gradient.addColorStop(1,'blue');
	context.fillStyle =gradient;
	context.fillText('今天周一',40,100)
</script>